package contest.dweek33;

import java.util.ArrayList;
import java.util.List;

/**
 * @author code_yc
 * @version 1.0
 * @date 2020/8/24 15:56
 */
public class Solution2 {

    List<Integer> res = new ArrayList<>();

    public List<Integer> findSmallestSetOfVertices(int n, List<List<Integer>> edges) {
        if (n == 0) return res;
        boolean[] f = new boolean[n];
        for (List<Integer> t : edges) {
            f[t.get(1)] = true;
        }
        for (int i = 0; i < n; i++) {
            if (!f[i]) res.add(i);
        }
        return res;
    }
}
